home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Games / Xconq 7.1.0 / src / xconq-7.1.0 / kernel / score.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-07  |  3.0 KB  |  70 lines  |  [TEXT/R*ch]

  1. /* Definitions relating to scorekeepers in Xconq.
  2.    Copyright (C) 1987, 1988, 1989, 1991, 1992, 1993, 1994, 1995
  3.    Stanley T. Shebs.
  4.  
  5. Xconq is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.  See the file COPYING.  */
  9.  
  10. typedef struct a_scorekeeper {
  11.     short id;                   /* unique id number */
  12.     char *title;                /* title by which this is displayed */
  13.     Obj *when;                  /* times at which this will run */
  14.     Obj *who;                   /* which sides this applies to */
  15.     SideMask whomask;        /* mask of sides this applies to */
  16.     Obj *knownto;               /* which sides know about this scorekeeper */
  17.     int initial;               /* initial value of a numeric score */
  18.     Obj *trigger;               /* test that decides triggering */
  19.     short triggered;            /* true when scorekeeper has been triggered */
  20.     Obj *body;                  /* the actual effect-causing stuff */
  21.     Obj *messages;              /* messages to display */
  22.     Obj *record;                /* how to record this in scorefile */
  23.     Obj *notes;                 /* random notes about the scorekeeper */
  24.     short scorenum;             /* index of this scorekeeper's score value */
  25.     struct a_scorekeeper *next; /* pointer to the next scorekeeper */
  26. } Scorekeeper;
  27.  
  28. /* Iteration over all scorekeepers. */
  29.  
  30. #define for_all_scorekeepers(sk)  \
  31.   for ((sk) = scorekeepers;  (sk) != NULL;  (sk) = (sk)->next)
  32.  
  33. #ifdef DESIGNERS
  34. #define keeping_score() (numscorekeepers > 0 && numdesigners == 0)
  35. #else
  36. #define keeping_score() (numscorekeepers > 0)
  37. #endif
  38.  
  39. #define recording_scores() (0)
  40.  
  41. extern Scorekeeper *scorekeepers;
  42.  
  43. extern int numscorekeepers;
  44.  
  45. extern int numscores;
  46.  
  47. extern int any_post_action_scores;
  48. extern int any_post_event_scores;
  49.  
  50. extern void init_scorekeepers PARAMS ((void));
  51. extern Scorekeeper *create_scorekeeper PARAMS ((void));
  52. extern Scorekeeper *find_scorekeeper PARAMS ((int id));
  53. extern void init_scores PARAMS ((void));
  54. extern void check_pre_turn_scores PARAMS ((void));
  55. extern void check_post_turn_scores PARAMS ((void));
  56. extern void check_post_action_scores PARAMS ((Unit *unit, Action *action, int rslt));
  57. extern void check_post_event_scores PARAMS ((HistEvent *hevt));
  58. extern void run_scorekeeper PARAMS ((Side *side, Scorekeeper *sk));
  59. extern int eval_sk_form PARAMS ((Side *side, Scorekeeper *sk, Obj *form));
  60. extern int sum_property PARAMS ((Side *side, Obj *form));
  61. extern int point_value PARAMS ((Unit *unit));
  62. extern int side_point_value PARAMS ((Side *side));
  63. extern int eval_sk_test PARAMS ((Side *side, Scorekeeper *sk, Obj *form));
  64. extern void side_wins PARAMS ((Side *side, int why));
  65. extern void side_loses PARAMS ((Side *side, Side *side2, int why));
  66. extern void all_sides_draw PARAMS ((void));
  67. extern void record_into_scorefile PARAMS ((void));
  68. extern int should_try_to_win PARAMS ((Side *side));
  69.  
  70.